<template>
    <div>
        <el-container>
            <el-aside class="Aside" width="auto">
                <Aside :SHOWFLAG="AsideShowFLAG"></Aside>
            </el-aside>
            <el-container>
                <el-header class="Header">
                    <Header @ChangeAside="ChangeAside"></Header>
                </el-header>
                <el-main class="Main">
                    <router-view></router-view>
                </el-main>
            </el-container>
        </el-container>
    </div>
</template>

<script setup lang='js' name=''>
// 组件
import showMessage from '@/utils/showMessage';
import Aside from './Home/Aside.vue';
import Header from './Home/Header.vue';
// 运行依赖
import { provide, ref } from 'vue'
import router from '@/router';

const UserName=ref(localStorage.getItem("SLZKName"))
provide("UserName",UserName)

if (!localStorage.getItem("SLZKLoginFlag")) {
    showMessage("请重新登录")
    router.push("/login")
}else{
    router.push('/home/default')
}

const AsideShowFLAG = ref(true)

function ChangeAside() { AsideShowFLAG.value = AsideShowFLAG.value ? false : true }
</script>

<style scoped>
.Header,
.Aside,
.Main {
    transition: all 0.5s;
    padding: 0;
    margin: 0;

}

.Header {
    background: var(--Home_HeaderBG);
}

.Main {
    background: var(--Home_MainBG);
    width: 100%;
    height: 100%;
}
</style>